//
//  UITextField+XZ.m
//  
//
//  Created by lixiangzhou on 14-8-1.
//  Copyright (c) 2014年 dxb. All rights reserved.
//

#import "UITextField+XZ.h"

@implementation UITextField (XZ)
+ (instancetype)textFieldWithPlaceholder:(NSString *)placeholder leftMargin:(CGFloat)leftMargin
{
    UITextField *textField = [[self alloc] init];
    textField.background = [UIImage resizeWithName:@"textfield_background"];
    textField.placeholder = placeholder;
    textField.borderStyle = UITextBorderStyleNone;
    UIView *leftView = [[UIView alloc] init];
    leftView.width = leftMargin;
    textField.leftView = leftView;
    textField.clearButtonMode = UITextFieldViewModeWhileEditing;
    textField.leftViewMode = UITextFieldViewModeAlways;
    
    return textField;
}
@end
